package admin;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class Del {
	public String exe(String table,String id) {
		try {
			Class.forName("com.mysql.jdbc.Driver");
			Getconfig gc=new Getconfig();
			String url=gc.getParaValue("connectUrl");
			Connection conn=DriverManager.getConnection(url);
			String sql="delete from "+table+" where id='"+id+"'";
			PreparedStatement ps=conn.prepareStatement(sql);
			ps.executeUpdate();
			ps.close();
			conn.close();
			return "删除成功！";
		} catch (Exception e) {
			// TODO: handle exception
			return "删除失败！";
		}
	}
}
